package android.test;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class LoginActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login);
    }
    public void onLoginClick(View view){
    	if(Vaification()){
    	Intent ProfilePage = new Intent(getApplicationContext(),ProfilePageActivity.class);
    	startActivity(ProfilePage);
    	return;
    	}
    }
    public void onCancelClick(View view){
    	finish();
    	return;
    }
    public boolean Vaification(){
    	TextView UsernameField = (TextView)findViewById(R.id.UsernameField);
    	TextView PasswordField = (TextView)findViewById(R.id.PasswordField);
    	if( UsernameField.getText().toString().equals("admin")&&PasswordField.getText().toString().equals("admin")){
    		return true;
    	}
    	return false;
    }
}
